inbreeding
estimates the inbreeding coefficient
of an individuals (F) by computing its likelihood function. It can
return either the density of probability of F, or a sample of F values
from this distribution. This operation is performed for all the
individuals of a inbreeding(x, pop = NULL, truenames = TRUE, res.type = c("sample", "function"), N = 200, M = N * 10)
pop(x)
. Note that the term population refers in
fact to any grouping of individuals'.res.type
argument).Let $p_i$ refer to the frequency of allele $i$ in the population. Let $h$ be an variable which equates 1 if the individual is homozygote, and 0 otherwise. For one locus, the probability of being homozygote is computed as:
$F + (1-F) \sum_i p_i^2$
The probability of being heterozygote is: $1 - (F + (1-F) \sum_i p_i^2)$
The likelihood of a genotype is defined as the probability of being the observed state (homozygote or heterozygote). In the case of multilocus genotypes, log-likelihood are summed over the loci.
Hs
: computation of expected heterozygosity.## cattle breed microsatellite data
data(microbov)
## isolate Lagunaire breed
lagun <- seppop(microbov)$Lagunaire
## estimate inbreeding - return sample of F values
Fsamp <- inbreeding(lagun, N=30)
## plot the first 10 results
invisible(sapply(Fsamp[1:10], function(e) plot(density(e), xlab="F", xlim=c(0,1), main="Density of the sampled F values")))
## compute means for all individuals
Fmean=sapply(Fsamp, mean)
hist(Fmean, col="orange", xlab="mean value of F", main="Distribution of mean F across individuals")
## estimate inbreeding - return proba density functions
Fdens <- inbreeding(lagun, res.type="function")
## view function for the first individual
Fdens[[1]]
## plot the first 10 functions
invisible(sapply(Fdens[1:10], plot, ylab="Density", main="Density of probability of F values"))
Run the code above in your browser using DataLab